-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for creating self-decrypting binaries #2315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
e684dcc
to
4c7b909
Compare
For now, this function embeds the decrypting bootloader, but probably better to integrate (or replace) existing pico_encrypt_binary function
Add newlines for readability, and explain why MbedTLS version is insecure
4c7b909
to
fd83496
Compare
…e examples compilation passes
…e examples compilation passes
@@ -380,19 +404,59 @@ function(pico_embed_pt_in_binary TARGET PTFILE) | |||
) | |||
endfunction() | |||
|
|||
# pico_encrypt_binary(TARGET AESFILE [SIGFILE]) | |||
# pico_encrypt_binary(TARGET AESFILE IVFILE [SIGFILE <file>] [EMBED] [MBEDTLS] [OTP_KEY_PAGE <page>]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth preemptively adding your \param\
stuff from #2422 here too, or is it too early for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll wait till that's merged, then rebase this and fix the issues that presumably pop up
This adds extra functionality to the
pico_encrypt_binary
function to allow creating self-decrypting binaries, including specifying the OTP page to use for the AES key.The main non-backwards-compatible change is the addition of a new IV salt bin file which is required and must be passed as the second argument. This will break any uses of
pico_encrypt_binary
, and has been added for security purposes, as we now salt the public IV with a salt stored in OTP.The other non-backwards-compatible change it that if you previously called:
you now need to call
due to the new argument parsing. I think that this is fine, because the only time you'd pass a separated
SIGFILE
topico_encrypt_binary
is when you're using a different signing key for the binary vs the encrypted blob, which is not a common use case.This PR requires use of the picotool encrypted-shares branch (raspberrypi/picotool#207), so should be merged after that.